<?php
include '../phpFunctions/imageResize.php';
$image = getimagesize("../Bildgalleri/Paintings/$picURL");
$newSizearray = imageResizeVector($image[0], $image[1], 320);
$newSizearray0 = $newSizearray[0] + 25;//Ugly solution to make the frame around the picture adapt to the picturesize
$newSizearray1 = $newSizearray[1] + 30;
 if ($newSizearray1 > 310){$newSizearray1 = 310; $newSizearray[1] = 280; }// To prevent the picture and frame to overflow downwards
?>

   




     <div id="grid-container">
         <div class="showItemStyle" >

<!--          Lådan i övre vänstra hörnet-->
          <div class="picBorders" style="top: 0px; left: 0px; margin-left: 0px; margin-top: 0px ">
          <center><h1><?php echo $itemTitle;?></h1>

          <div class ="frame" style ="width: <?php print "$newSizearray0"?>; height: <?php print"$newSizearray1" ?> ;">

              <br><img src ="../Bildgalleri/Paintings/<?php echo $picURL; ?>" <?php echo "width = $newSizearray[0] height = $newSizearray[1] "; ?>>
          </div></center>
          </div>


<!--              Lådan i övre högra hörnet-->
          <div class="info1Borders" style="top: 0px; left: 456px; margin-left: 0px; margin-top: 0px " >
          <br>
          <h3>Produktinformation</h3><br>
          <b>Pris:</b> <?php echo $itemPrice;?>kr&nbsp;&nbsp;&nbsp;<br>
          <b>Storlek:</b> <?php echo $itemSize;?>&nbsp;&nbsp;&nbsp;<br>
          <b>Genre:</b> <?php echo $maincategory;?>&nbsp;&nbsp;&nbsp;<br>
          <b>Underkategori:</b> <?php echo $subcategory;?> &nbsp;&nbsp;&nbsp;<br>
          <b>Uppladdad:&nbsp;</b><?php echo $itemUploadDate;?>
          </div>


<!--                  Lådan i nedre vänstra hörnet-->
          <div class="infoBorders" style="top: 369px; left: 0px; margin-left: 0px; margin-top: 0px " >
          <center>
          <br>
          <h3>Kontaktuppgifter</h3>
          <p><b>Skapad av:</b> <?php echo  "<a href='", '../getProfile/getprofile.php', '?profileName=' . $itemUsername . "'>$itemUsername<a>";
?></p>
          <p><b>Finns i:</b> <?php echo $itemLocation;?></p>
          <p><b>E-mail adress:</b> <?php echo $itemEmail;?></p>
          <p><b>Telefon:</b> <?php echo $itemPhoneNumber;?></p>
<!--          If the owner enters the page there is an option to change/remove it-->
          <?php
          if (isset($_SESSION['login'])) {
          if ($_SESSION['myusername']==$itemUsername){
          echo  "<a href='", $url, '?itemID=' . $itemID . "'>";
          print '<center>Ändra/Ta bort annons</center></a>';
                                                      }
                                         }
          ?>
          </center>
          </div>

<!--          Lådan i nedre högra hörnet-->
          <div class="descriptionBorders" style="top: 250px; left: 456px; margin-left: 0px; margin-top: 0px " >
          <center><br>
          <h3>Beskrivning:</h3>
          <p><?php echo $itemDescription;?></p>
          </center>
          </div>


     

<!--            Nedersta lådan, innehåller 5 random målningar av konstnären-->
          <div class="paintingsBorders" style="top: 500px; left: 0px; margin-left: 0px; margin-top: 0px " >
          <center><br>
         
         
            <?php
            print "<h3>Fler konstverk utav  ";
            echo  "<a href='", '../getProfile/getprofile.php', '?profileName=' . $itemUsername . "'>$itemUsername<a></h3><br>" ;
            include '../phpFunctions/fiveRandomPaintings.php';
            ?>
            </center>
            </div>




</div></div>

